package cz.muni.fi.pa165.travelagency.persistence;

import cz.muni.fi.pa165.travelagency.entities.PackageTour;
import java.util.Date;
import java.util.List;

/**
 * @author Lukas Jungmann
 * @version 1.0
 */
public interface IPackageTourDAO {

    /**
     * Create <code>PackageTour</code> in persistent repository
     * @param pt <code>PackageTour</code> to store
     * @throws IllegalArgumentException if any of defined attributes is not valid (typically null or &lt; 1)
     * @throws IllegalStateException if <code>ID</code> of given <code>PackageTour</code> is null
     */
    public void createPackageTour(PackageTour pt);

    /**
     * Delete <code>PackageTour</code> from persistent repository
     * @param pt <code>PackageTour</code> to delete
     * @throws IllegalArgumentException if given <code>PackageTour</code> is null
     * @throws IllegalStateException if <code>ID</code> of given <code>PackageTour</code> is null
     */
    public void deletePackageTour(PackageTour pt);

    /**
     * Find all <code>PackageTour</code>s in a persistent repository
     * according to defined attributes
     *
     * @param destination destination
     * @param maxPrice maximum price
     * @param dateFrom start date
     * @param dateTo end date
     * @param numberOfPersons capacity of the <code>PackageTour</code>
     * @return all <code>PackageTour</code>s meeting given criteria
     */
    public List<PackageTour> find(String destination, int maxPrice, Date dateFrom, Date dateTo, int numberOfPersons);

    /**
     * Find all <code>PackageTour</code>s in a persistent repository
     *
     * @return all <code>PackageTour</code>s from the persistent repository
     */
    public List<PackageTour> findAll();

    /**
     * Get available seats in given <code>PackageTour</code>
     * @param pt <code>PackageTour</code> to check
     * @return number of available seats in given <code>PackageTour</code>
     */
    public int getAvailablePlaces(PackageTour pt);

    /**
     * Get a <code>PackageTour</code> with given <code>id</code>
     * @param id id of the <code>PackageTour</code>
     * @return <code>PackageTour</code> with given <code>id</code>
     * @throws IllegalArgumentException if id is null
     */
    public PackageTour getPackageTour(Long id);

    /**
     * Update given <code>PackageTour</code>s in a persistent repository
     * @param pt <code>PackageTour</code> to update
     * @throws IllegalArgumentException if <code>pt</code> is null
     * @throws IllegalStateException if <code>ID</code> of given <code>PackageTour</code> is null
     */
    public void updatePackageTour(PackageTour pt);
}
